template(name="board")
  
  if isMigrating.get
    +migrationProgress
  else if isConverting.get
    +boardConversionProgress
  else if isBoardReady.get
    if currentBoard
      if onlyShowCurrentCard
        +cardDetails(currentCard)
      else
        +boardBody
    else
      //-- XXX We need a better error message in case the board has been archived
      +message(label="board-not-found")
      //-- | {{goHome}}
  else
    +spinner

template(name="boardBody")
  if notDisplayThisBoard
   | {{_ 'tableVisibilityMode-allowPrivateOnly'}}
  else
    // Debug information (remove in production)
    if debugBoardState
      .debug-info(style="position: fixed; top: 0; left: 0; background: rgba(0,0,0,0.8); color: white; padding: 10px; z-index: 9999; font-size: 12px;")
        | Board: {{currentBoard.title}} | View: {{boardView}} | HasSwimlanes: {{hasSwimlanes}} | Swimlanes: {{currentBoard.swimlanes.length}}
    .board-wrapper(class=currentBoard.colorClass class="{{#if isMiniScreen}}mobile-view{{/if}}")
      .board-canvas.js-swimlanes(
        class="{{#if hasSwimlanes}}dragscroll{{/if}}"
        class="{{#if Sidebar.isOpen}}is-sibling-sidebar-open{{/if}}"
        class="{{#if MultiSelection.isActive}}is-multiselection-active{{/if}}"
        class="{{#if draggingActive.get}}is-dragging-active{{/if}}"
        class="{{#unless isVerticalScrollbars}}no-scrollbars{{/unless}}"
        class="{{#if isMiniScreen}}mobile-view{{/if}}")
        if showOverlay.get
          .board-overlay
        if currentBoard.isTemplatesBoard
          each currentBoard.swimlanes
            +swimlane(this)
        else if isViewSwimlanes
          if hasSwimlanes
            each currentBoard.swimlanes
              +swimlane(this)
          else
            // Fallback: If no swimlanes exist, show lists instead of empty message
            +listsGroup(currentBoard)
        else if isViewLists
          +listsGroup(currentBoard)
        else if isViewCalendar
          +calendarView
        else
          // Default view - show swimlanes if they exist, otherwise show lists
          if hasSwimlanes
            each currentBoard.swimlanes
              +swimlane(this)
          else
            +listsGroup(currentBoard)
      +sidebar

template(name="calendarView")
  if isViewCalendar
    .calendar-view.swimlane
      if currentCard
        +cardDetails(currentCard)
      +fullcalendar(calendarOptions)
